import 'dart:convert';

class BluetoothMsg{
  //推送的内容码，代表携带着哪种类型的数据
  //蓝牙状态
  static const int PUSHCODE_BLUETOOTH_STATE = 21;
  //发现蓝牙
  static const int PUSHCODE_FIND_BLUETOOTH = 22;
  //蓝牙扫描状态
  static const int PUSHCODE_SCAN_STATE = 23;
  //读取到的蓝牙信息
  static const int PUSHCODE_READ_MSG = 24;
  //蓝牙连接状态
  static const int PUSHCODE_BLUETOOTH_CONNECTED_STATE = 25;

  //蓝牙状态码 -1 设备不支持蓝牙 10 关闭 11 正在打开 12 打开 13 正在关闭
  static const int STATE_NO_SUPPORT = -1;
  static const int STATE_OFF = 10;
  static const int STATE_TURNING_ON = 11;
  static const int STATE_ON = 12;
  static const int STATE_TURNING_OFF = 13;
  //蓝牙扫描状态码
  static const int SCAN_STATE_START = 11;
  static const int SCAN_STATE_OVER = 12;
  //蓝牙连接状态码
  static const int CONNECT_STATE_CONNECTED = 13;
  static const int CONNECT_STATE_UNCONNECT = 14;
  static const int CONNECT_STATE_FAIL = 15;

  //推送的数据
  int pushCode, state, scanState, connectedState;
  String name, address, msg;

  BluetoothMsg.fromJson(Map<String, dynamic> map){
    pushCode = map["pushCode"];
    state = map["state"];
    scanState = map["scanState"];
    connectedState = map["connectedState"];
    name = map["name"];
    address = map["address"];
    msg = map["msg"];
  }



}